#include "flash_blob.h"

static const uint32_t flash_code[] =
{
    0XE00ABE00,0X062D780D,0X24084068,0XD3000040,0X1E644058,0X1C49D1FA,0X2A001E52,0X4770D1F2,
    0X8F4FF3BF,0X03C04770,0X47700E80,0X49344835,0X49356081,0X49356081,0X20006101,0X20014770,
    0X07C04930,0X20006148,0X20014770,0X482D4770,0X61024A2E,0X61412104,0X23016941,0X4319041B,
    0XF3BF6141,0X69018F4F,0XD4FC03C9,0X61412100,0X42116901,0X6901D004,0X61014311,0X47702001,
    0X47702000,0X0E8103C0,0X4A20481E,0X00C96102,0X61411C89,0X23016941,0X4319041B,0XF3BF6141,
    0X69018F4F,0XD4FC03C9,0X61412100,0X42116901,0X6102D002,0X47702001,0X47702000,0X1DC9B5F0,
    0X08C94C10,0X00C94D11,0X26016125,0XE0132700,0X68136166,0X68536003,0XF3BF6043,0X69238F4F,
    0XD4FC03DB,0X69236167,0XD002422B,0X20016125,0X3008BDF0,0X32083908,0XD1E92900,0XBDF02000,
    0X45670123,0X40022000,0XCDEF89AB,0X0000C3FA,0X00000000,
};

const program_target_t flash_algo_STM32G0XX =
{
    0X2000002D,  // Init
    0X2000003F,  // UnInit
    0X2000004F,  // EraseChip
    0X20000085,  // EraseSector
    0X200000BD,  // ProgramPage

    // BKPT : start of blob + 1
    // RSB  : address to access global/static data
    // RSP  : stack pointer
    {
        0X20000001,
        0X20000C00,
        0X20001000,
    },

    0x20000400,                      // mem buffer location
    0x20000000,                      // location to write prog_blob in target RAM
    sizeof(flash_code),              // prog_blob size
    flash_code,                      // address of prog_blob
    0x00000400,                      // ram_to_flash_bytes_to_be_written
};
